package com.modbus.tcp.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.modbus.tcp.mapper.BallvalvedataMapper;
import com.modbus.tcp.domain.Ballvalvedata;
import com.modbus.tcp.service.IBallvalvedataService;
import com.modbus.tcp.utils.Convert;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 球阀modbus数据 服务层实现
 *
 * @author d
 * @date 2024-01-11
 */
@RestController
public class BallvalvedataServiceImpl implements IBallvalvedataService {

    @Autowired
    private BallvalvedataMapper ballvalvedataMapper;

    @Override
    public List<Ballvalvedata> selectHisAlarmdata(){
        return  ballvalvedataMapper.selectHisAlarmdata();
    }
    /**
     * 查询球阀modbus数据信息
     *
     * @param sensordataid 球阀modbus数据ID
     * @return 球阀modbus数据信息
     */
    @Override
    public Ballvalvedata selectBallvalvedataById(Integer sensordataid) {
        return ballvalvedataMapper.selectBallvalvedataById(sensordataid);
    }

    /**
     * 查询球阀modbus数据列表
     *
     * @param ballvalvedata 球阀modbus数据信息
     * @return 球阀modbus数据集合
     */
    @Override
    public List<Ballvalvedata> selectBallvalvedataList(Ballvalvedata ballvalvedata) {
        return ballvalvedataMapper.selectBallvalvedataList(ballvalvedata);
    }


    /**
     * 新增球阀modbus数据
     *
     * @param ballvalvedata 球阀modbus数据信息
     * @return 结果
     */
    @Override
    public int insertBallvalvedata(Ballvalvedata ballvalvedata) {
        return ballvalvedataMapper.insertBallvalvedata(ballvalvedata);
    }

    /**
     * 修改球阀modbus数据
     *
     * @param ballvalvedata 球阀modbus数据信息
     * @return 结果
     */
    @Override
    public int updateBallvalvedata(Ballvalvedata ballvalvedata) {
        return ballvalvedataMapper.updateBallvalvedata(ballvalvedata);
    }

    /**
     * 删除球阀modbus数据对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBallvalvedataByIds(String ids) {
        return ballvalvedataMapper.deleteBallvalvedataByIds(Convert.toStrArray(ids));
    }


    @Override
    public int insertBallvalvedataList( List<Ballvalvedata> list) {
        return ballvalvedataMapper.insertBallvalvedataList(list);
    }

    @Override
    public List<Ballvalvedata> selectSensordataList(Integer id){
        return ballvalvedataMapper.selectSensordataList(id);
    }
}